﻿<div class="page-body">
    <div class="row">
        <div class="col-xs-12 col-md-12">
            <div class="widget">
                <div class="widget-header
            <switch name="T_type">
                <case value="1">bg-magenta</case>
                <case value="2">bg-palegreen</case>
                <case value="3">bg-lightred</case>
                <case value="4">bg-blue</case>
                <case value="5">bg-blueberry</case>
                <case value="6">bg-gold</case>
                <default />bg-magenta
                </switch>
                                ">
                <span class="widget-caption">{$T_title|default=CONTROLLER_NAME}</span>
                                <!--Widget Buttons-->
            </div>
                <div class="widget-body">
                    <div class="table-toolbar">
                        <form method="get" action="{:U('index')}" class="form-inline" role="form">
                            <div class="form-group">
                                <span class="input-icon" style="width: 200px;">
                                    <input type="text" class="form-control input-sm" placeholder="ID（流水号）"
                                           name="keywords" value="{$Think.get.keywords}">
                                    <i class="glyphicon glyphicon-search blue"></i>
                                </span>
                                类型：
                                <span class="input-icon" style="width: 100px;">
                                    <select name="type">
                                        <option value="0"
                                        <eq name="Think.get.type" value="1">selected='selected'</eq>
                                        >全部</option>
                                        <option value="1"
                                        <eq name="Think.get.type" value="1">selected='selected'</eq>
                                        >借书</option>
                                        <option value="2"
                                        <eq name="Think.get.type" value="2">selected='selected'</eq>
                                        >购书</option>
                                        <option value="3"
                                        <eq name="Think.get.type" value="3">selected='selected'</eq>
                                        >充值</option>
                                        <option value="4"
                                        <eq name="Think.get.type" value="4">selected='selected'</eq>
                                        >活动</option>
                                        <option value="5"
                                        <eq name="Think.get.type" value="5">selected='selected'</eq>
                                        >破损回收</option>
                                    </select>
                                </span>
                                日期区间：
                                <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </span>
                                    <input type="text" class="form-control active" name="time" id="reservation" value="{$Think.get.time}">
                                </div>
                                <button type="submit" class="btn btn-info">搜索</button>
                                <button type="submit" class="btn btn-info" name="excel" value="1">导出当前</button>
                            </div>
                        </form>
                    </div>

                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>会员卡号</th>
                            <th>ID</th>
                            <th>类型</th>
                            <th>付款方式</th>
                            <th>应付款</th>
                            <th>实收</th>
                            <th>找零</th>
                            <th>简述</th>
                            <th>发生时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="data" id="vo">
                            <tr>
                                <td>{$vo.card_id}</td>
                                <td>
                                    <switch name="vo.type">
                                        <case value="1">
                                            <a href="{:U('PayBorrow/index',['pay'=>$vo['pay_id']])}" target="_blank">{$vo.pay_id}</a>
                                        </case>
                                        <case value="2">
                                            <a href="{:U('PayBuy/index',['pay'=>$vo['pay_id']])}" target="_blank">{$vo.pay_id}</a>
                                        </case>
                                        <case value="3">
                                            <a href="{:U('PayMember/index',['pay'=>$vo['pay_id']])}" target="_blank">{$vo.pay_id}</a>
                                        </case>
                                        <case value="4">
                                            <a href="{:U('PayActivity/index',['pay'=>$vo['pay_id']])}" target="_blank">{$vo.pay_id}</a>
                                        </case>
                                        <case value="5">
                                            <a href="{:U('LogBroken/index',['pay'=>$vo['pay_id']])}" target="_blank">{$vo.pay_id}</a>
                                        </case>
                                        <default/>
                                        {$vo.pay_id}
                                    </switch>
                                </td>
                                <td>
                                    <switch name="vo.type">
                                        <case value="1">借书</case>
                                        <case value="2">买书</case>
                                        <case value="3">充值</case>
                                        <case value="4">活动</case>
                                        <case value="5">破损处理</case>
                                        <default/>
                                        {$vo.type}
                                    </switch>
                                </td>
                                <td>
                                    {$vo.way}
                                </td>
                                <th>
                                    ￥{$vo.money}
                                </th>
                                <th>
                                    ￥{$vo.money_real}
                                </th>
                                <td>
                                    ￥{$vo.money_zero}
                                </td>
                                <td>
                                    {$vo.summary}
                                </td>
                                <td>
                                    {$vo.create_time}
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                        <tfoot class="calculate-show">
                        <tr>
                            <th colspan="8">
                                共计
                                应收款：{$dsum.money_total}
                                实收款：{$dsum.money_real_total}元，
                                找零：{$dsum.money_zero_total}元，
                                总收入：{$dsum.money_fact_total}元，
                                优惠金额：{$dsum.money_cheap_total}元，
                            </th>
                        </tr>
                        </tfoot>
                    </table>
                    {$page}
                    <form class="form-inline" method="post">
                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-addon">设置页码</div>
                                <input class="form-control" type="text" placeholder="" name="p" value="{$Think.get.p}" style="width: 60px;">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/admin/js/datetime/moment.js"></script>
<script src="/admin/js/datetime/daterangepicker.js"></script>
<script>
    $('#reservation').daterangepicker({
        format: "YYYY-MM-DD",
        separator: "~",
        locale: {
            applyLabel: '确定',
            cancelLabel: '取消',
            fromLabel: '开始时间',
            toLabel: '结束时间'
        }
    });

</script>